From 4d4ed60a2cf30c0de744eb4fac37772cca1c390b Mon Sep 17 00:00:00 2001 From: "awilliam@xenbuild2.aw" Date: Sun, 4 Feb 2007 11:36:12 -0700 Subject: [PATCH] [IA64] Fix PAL_HALT for paravirtualized domains machine_halt() stops the vcpus, but no longer destroys the domain. This should be more in-line with the behavior on native hardware. Signed-off-by: Akio Takebe --- linux-2.6-xen-sparse/arch/ia64/kernel/setup.c | 8 ++++++++ xen/arch/ia64/xen/fw_emul.c | 6 ++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/linux-2.6-xen-sparse/arch/ia64/kernel/setup.c b/linux-2.6-xen-sparse/arch/ia64/kernel/setup.c index a56bbbdc53..74f21997c7 100644 --- a/linux-2.6-xen-sparse/arch/ia64/kernel/setup.c +++ b/linux-2.6-xen-sparse/arch/ia64/kernel/setup.c @@ -95,6 +95,13 @@ xen_panic_event(struct notifier_block *this, unsigned long event, void *ptr) static struct notifier_block xen_panic_block = { xen_panic_event, NULL, 0 /* try to go last */ }; + +void xen_pm_power_off(void) +{ + printk("%s called\n", __FUNCTION__); + local_irq_disable(); + HYPERVISOR_shutdown(SHUTDOWN_poweroff); +} #endif extern void ia64_setup_printk_clock(void); @@ -456,6 +463,7 @@ setup_arch (char **cmdline_p) /* Register a call for panic conditions. */ atomic_notifier_chain_register(&panic_notifier_list, &xen_panic_block); + pm_power_off = xen_pm_power_off; } #endif diff --git a/xen/arch/ia64/xen/fw_emul.c b/xen/arch/ia64/xen/fw_emul.c index 2a9f8fcb53..905d29c6fd 100644 --- a/xen/arch/ia64/xen/fw_emul.c +++ b/xen/arch/ia64/xen/fw_emul.c @@ -605,9 +605,11 @@ xen_pal_emulator(unsigned long index, u64 in1, u64 in2, u64 in3) printk ("Domain0 halts the machine\n"); console_start_sync(); (*efi.reset_system)(EFI_RESET_SHUTDOWN,0,0,NULL); + } else { + set_bit(_VCPUF_down, ¤t->vcpu_flags); + vcpu_sleep_nosync(current); + status = PAL_STATUS_SUCCESS; } - else - domain_shutdown(current->domain, SHUTDOWN_poweroff); break; case PAL_HALT_LIGHT: if (VMX_DOMAIN(current)) { -- 2.30.2